<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    
<%@ page import="board1.BoardDAO" %>
<%@ page import="board1.BoardTO" %>
<%@ page import="board1.ReplyDAO" %>
<%@ page import="board1.ReplyTO" %>

<%
	request.setCharacterEncoding("UTF-8");
	
	BoardTO to = new BoardTO();
	to.setPhone_number(request.getParameter("phone_number"));
	to.setIdx(request.getParameter("idx"));
	
	log("phone_number :" + request.getParameter("phone_number"));
	log("idx :" + request.getParameter("idx"));
	
	BoardDAO dao = new BoardDAO();
	
	if(dao.deleteBoard(to)) {
		
		ReplyTO rep_to = new ReplyTO();
		rep_to.setPhone_number(request.getParameter("phone_number"));
		rep_to.setIdx(request.getParameter("idx"));
		
		ReplyDAO rep_dao = new ReplyDAO();
		
		if(rep_dao.deleteReply(rep_to)) {
			out.println("SUCCESS");
		} else {
			out.println("FAIL");
		}		
	} else {
		out.println("FAIL");
	}
%>